<template>
  <button :class="{ 'is-loading': isLoading }" @click="handleClick">
    <span v-if="!isLoading">点击我</span>
    <span v-else>加载中...</span>
  </button>
</template>

// 下一行代码：

<script>
  export default {
    data() {
      return {
        isLoading: false,
      }
    },
    methods: {
      handleClick() {
        this.isLoading = true
        setTimeout(() => {
          this.isLoading = false
        }, 2000)
      },
    },
  }
</script>

// 下一行代码：
<style scoped>
  .is-loading {
    cursor: not-allowed;
    opacity: 0.5;
  }
</style>
